<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('room/index')}">所有班级</a></li>
        <li><a href="{:url('room/add')}">添加班级</a></li>
    </ul>
    <form class="well form-inline margin-top-20"  method="get" action="{:url('room/index')}">
        学校名称：
        <select name="school_id" class="form-control">
            <option value="">--请选择学校--</option>
            <foreach name="school" item="vo">
                <php>$selectedSchool = $vo['id']==$school_id?"selected":""</php>
                <option value="{$vo.id}" {$selectedSchool}>{$vo.name}</option>
            </foreach>
        </select>
        班级名称：
        <input type="text" class="form-control" name="name" style="width:150px" value="{:input('request.name/s')}" placeholder="请输入班级">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('room/index')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('room/delAll')}">
        <div class="table-actions">
            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                    data-action="{:url('room/delAll')}" data-subcheck="true">批量删除
            </button>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                                 data-checklist="js-check-x"></label>
                    </th>
                    <th width="80">ID</th>
                    <th>班级名称</th>
                    <th>量化总分</th>
                    <th>学校名称</th>
                    <th width="160">{:lang('ACTIONS')}</th>
                </tr>
            </thead>
           <tbody>
           <foreach name="room" item="vo">
               <tr>
                   <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                              value="{$vo.id}">
                   </td>
                   <td>{$key+1}</td>
                   <td>{$vo.name}</td>
                   <td>{$vo.total | default ='暂无'}</td>
                   <td>{$vo.school_name}</td>
                   <td>
                       <a class="btn btn-xs btn-success" href="{:url('room/mingxi',array('id'=>$vo['id']))}">明细</a>
                       <a class="btn btn-xs btn-success" href="{:url('room/edit',array('id'=>$vo['id']))}">编辑</a>
                       <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('room/delete',array('id'=>$vo['id']))}">删除</a>
                   </td>
               </tr>
           </foreach>
           </tbody>
        </table>
    <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>